/*
  Automatically instantiates modules based on data-attributes
  specifying module file-names.
*/
const moduleElements = document.querySelectorAll('[data-module]')

for (var i = 0; i < moduleElements.length; i++) {
  const el = moduleElements[i]
  const name = el.getAttribute('data-module')
  // console.log(require(`./${name}`))
  //

  const Module =require(`./${name}`).default
  new Module(el)
}
$.ajax({
  url: "index/getstarlist",
  method:'post',
  dataType:'json',
  success: function (result) {
    var str='';
   
    
    result.data.cate.forEach(element => {
      str+="<li>"+element+"</li>"
    });
    $('.list').html(str)
  }
});
console.log(123)
/*
  Usage:
  ======

  html
  ----
  <button data-module="disappear">disappear!</button>

  js
  --
  // modules/disappear.js
  export default class Disappear {
    constructor(el) {
      el.style.display = 'none'
    }
  }
*/
